{% extends "school/layout.html" %}

{% set blcok_titles=['与 The ONE 共同成长', 'The ONE智能钢琴教室资料库', '常见问题', '教学示范与支持'] %}
{% set page_title = blcok_titles[bid] %}

{% block content %}
<style>
.inform_more{
    display: block;
    float: right;
    margin-top: -24px;
    color: black;
}
.tab{
    position: absolute;
    margin-left: 40px;
    margin-top: 10px;
    color: #ccc;
}
.tab a{
    color: #ccc;
}
.block_title{
    width: 80%;
}
.m-index h3.title {
    color: #62a924;
    font-size: 28px;
}
table td a{
    color:#333;
}
</style>
<div class="tab">
    <a href="{{ url_for('school.index') }}">{{translate('首页')}}</a>
    > {{ translate(block_title) }}
</div>

<div class="m-scontent m-index">
    <h3 class="title">{{ translate(block_title) }}</h3>
    <div class="wrap" style="margin-right: 40px;">
    <table style="margin-top: 40px;" data-toggle="table" class="table table-striped table-condensed table-bordered">
        <thead>
            <tr>
                <th class="block_title">{{translate('标题')}}</th>
                <th>{{translate('更新时间')}}</th>
                {% if pagination %}
                <th>{{translate('状态')}}</th>
                {% endif %}
            </tr>
        </thead>
        <tbody>
            {% if pagination %}
                {% for item in pagination.items %}
                <tr id="{{ item.id }}">
                    <td>
                        <a href="{{ item.url}}" target="_blank">
                            {{ item.title }}
                        </a>
                    </td>
                    <td>
                        {{ item.updated_at }}
                    </td>
                    <td>
                        {% if item.read_status %}
                            <a href="/school/block_list/has_read">{{translate('已读')}}</a>
                        {% else %}
                            <a style="color: red;" href="/school/block_list/not_read">{{translate('未读')}}</a>
                        {% endif %}
                    </td>
                </tr>
                {% endfor %}
            {% else %}
                {% for item in contents %}
                <tr id="{{ item.id }}">
                    <td>
                        <a href="{{ item.url}}" target="_blank">
                            {{ item.title }}
                        </a>
                    </td>
                    <td>
                        {{ item.updated_at }}
                    </td>
                </tr>
                {% endfor %}
            {% endif %}
        </tbody>
    </table>
    {% if pagination%}
        {% include "school/pagination.html" %}
    {% endif %}
    </div>
</div>
{% endblock %}